]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
TelepathyClient: disconnect signals from destroyed ChatSources
authorGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 20 Jan 2014 22:21:14 +0000 (23:21 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 28 Jan 2014 20:50:07 +0000 (21:50 +0100)
Otherwise they keep firing if the source is destroyed by the user
and they trigger Clutter warnings from touching invalid actors.

https://bugzilla.gnome.org/show_bug.cgi?id=722660

js/ui/components/telepathyClient.js

index e69c2a18e77357bf310cdac4dc78b3ac6b1df93b..144d369b2674f6d77cbd89f1647e0b0a9ad2f64c 100644 (file)
@@ -621,7 +621,11 @@ const ChatSource = new Lang.Class({
             this.notify();
     },
 
-    _channelClosed: function() {
+    destroy: function(reason) {
+        if (this._destroyed)
+            return;
+
+        this._destroyed = true;
         this._channel.disconnect(this._closedId);
         this._channel.disconnect(this._receivedId);
         this._channel.disconnect(this._pendingId);
@@ -631,7 +635,14 @@ const ChatSource = new Lang.Class({
         this._contact.disconnect(this._notifyAvatarId);
         this._contact.disconnect(this._presenceChangedId);
 
-        this.destroy();
+        if (this._timestampTimeoutId)
+            Mainloop.source_remove(this._timestampTimeoutId);
+
+        this.parent(reason);
+    },
+
+    _channelClosed: function() {
+        this.destroy(MessageTray.NotificationDestroyedReason.SOURCE_CLOSED);
     },
 
     /* All messages are new messages for Telepathy sources */